i = 1
list = []
while i <= 100:
    list.append(i*i)
    i += 1
print(list)
# python内置的sum函数，返回list中所有元素的和
print(sum(list))